//
//  ShiftToCashDepVC.m
//  NtoccShipper
//
//  Created by mac on 2020/2/17.
//  Copyright © 2020 zhuchongjin. All rights reserved.
//

#import "ShiftToCashDepVC.h"

@interface ShiftToCashDepVC ()
@property (nonatomic,strong) CJTextField *fieldBalaceMoney;
@property (nonatomic,strong) CJTextField *fieldShitToMoney;
@end

@implementation ShiftToCashDepVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self setTitleName:CJLString(@"转入到保证金")];
    [self setBackLeftButton:@""];
    [self createTableView];
    [self setFieldLimit];
}

- (void)createTableView{
    
    NSString *strType = @"ShiftToCashDepView";

    CGRect rcFrame = CGRectMake(0, kTopHeight, [[UIScreen mainScreen] bounds].size.width, 0);
    FlexFrameView *header = [[FlexFrameView alloc] initWithFlex:strType Frame:rcFrame Owner:self];
    header.flexibleHeight = YES;
    //        self.labTitle.text = @"您已通过实名认证";
    self.fieldBalaceMoney.text = self.strEnsureFeeAmount;
    [header layoutIfNeeded];
    [self.view addSubview:header];
}

- (void)setFieldLimit{
    self.fieldShitToMoney.textFieldType = CJTextFieldStringTypeMoneyValue;
    self.fieldShitToMoney.maxLength = CJTextLengthTen;
}
- (void)btnShiftToCashDepAction{
    
    if ([CJRegular getIsStrEmpty:self.fieldShitToMoney.text]) {
        [CJAlert showStringDismissWithDelay:@"请填写转入金额"];
    }else if (![CJRegular getIsMonayValue:self.fieldShitToMoney.text]){
        [CJAlert showStringDismissWithDelay:@"请填写正确类型金额"];

    }else{
        
        NSString *strUrl = CJStringWithFormat(@"%@/ntocc-basic-api/shipment/addInsureFeeAmount",CJBaseUrl);
        NSDictionary *dicPra = @{
            @"fee":self.fieldShitToMoney.text
        };
        @weakify(self);
        [[HDNetworking sharedHDNetworking] PUT:strUrl parameters:dicPra success:^(id  _Nonnull responseObject) {
            
            @strongify(self);
            DLog(@"=====%@",responseObject);
            [self pop];
            
        } failure:^(NSError * _Nonnull error) {
            
        }];
    }

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
